<template>
	<view class='mysak'>
		<view class='teatareabox'>
			<textarea class="mysakbox" v-model='mysakvalue'  placeholder="请输入问题详细内容" placeholder-class="input_class" />
		</view>
		<view class="commonchooseview" @click='gochoosecategory'>
			<view class='zombietitle'>选择分类</view>
			<view class="chooseresult">{{cate_name}}</view>
			<image class='goimg' src='../../static/image/zxwb_ico_jr_b@2x.png'></image>
		</view>
		<view class='entrue' @click='exception'>确认</view>
	</view>
</template>

<script>
	import {asksave} from '@/api/data.js'
	export default {
		data() {
			return {
				
				mysakvalue:'',
				cate_id:'',//问题分类
				cate_name:'选择分类'
			}
		},
		onShow() {
			if(uni.getStorageSync('choosequestionid')){
				this.cate_id = uni.getStorageSync('choosequestionid')
				this.cate_name = uni.getStorageSync('choosequestionname')
				uni.removeStorageSync('choosequestionid')
				uni.removeStorageSync('choosequestionname')
			}
		},
		methods: {
			gochoosecategory(){
				uni.navigateTo({
					url:'../qusetioncategory/qusetioncategory'
				})
			},
			// 提交问题
			exception(){
				let obj = {
					content:this.mysakvalue,
					ask_cate_id:this.cate_id
				}
				asksave(obj).then(res=>{
					if(res.code == 1){
						this.$msg(res.msg)
						setTimeout(()=>{
							uni.navigateBack({
								delta:1
							})
						},800)
					}else{
						this.$msg(res.msg)
					}
				})
			}
		}
	}
</script>

<style>
	.mysak{
		height:100%;
		width:100%;
		background-color: #F5F5F5;
		padding: 20rpx 30rpx 0;
	}
	.teatareabox{
		height:auto;
		width:100%;
		background-color: #FFFFFF;
		padding: 30rpx 20rpx;
		border-radius: 10rpx;
	}
	.mysakbox{
		height: 400rpx;
		width:100%;
		/* padding-top: 20rpx; */
	}
	.input_class{
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #999999;
	}

	/* 通用选择样式 */
	.commonchooseview{
		margin-bottom: 100rpx;
		padding: 0 20rpx;
		display: flex;
		margin-top: 20rpx;
		background-color: #FFFFFF;
		width:100%;
		justify-content: space-between;
		align-items: center;
		height:100rpx;
		font-size: 28rpx;
		border-radius: 10rpx;
	}
	.zombietitle{
		width:140rpx;
		flex-shrink: 0;
		/* border:1rpx solid red; */
	}
	.chooseresult{
		width:100%;
		font-family: PingFang SC;
		font-weight: 500;
		color: #999999;
	}
	.goimg{
		width:12rpx;
		height:22rpx;
		flex-shrink: 0;
	}
	
	
	.entrue{
		width: 650rpx;
		height: 88rpx;
		line-height: 88rpx;
		margin:0 auto;
		
		text-align: center;
		background: #FFDD47;
		border-radius: 10px;
	}
</style>

